<template>
    <el-dialog :visible.sync="visible" :before-close="close" >
      <el-form>
        <el-form-item label="视频类型">
          <el-radio-group v-model="formData.playerType" @change="playerTypeChanged">
            <el-radio label="webrtc"></el-radio>
            <el-radio label="flv"></el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
    </el-dialog>
</template>

<script>
export default {
  name: "VideoSetting",
  props:{
    visible: Boolean
  },
  data(){
    return {
      formData:{
        playerType: this.$store.state.video.playerType
      }
    }
  
  },
  

  methods: {
    close(){
      this.$emit('update:visible', false);
    },
    playerTypeChanged(){
      this.$store.dispatch('video/setPlayerType', this.formData.playerType);
      location.reload();
    }
  },
  
};
</script>
